import 'package:flutter/material.dart';
import 'package:flutter_taotaoshipin/util/image_utils.dart';
import 'package:flutter_taotaoshipin/widget/load_image.dart';

class EmptyView extends StatelessWidget {
  const EmptyView({super.key, this.tips, this.retryAction});

  final String? tips;
  final VoidCallback? retryAction;

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          LoadAssetImage(
            'state/empty',
            format: ImageFormat.jpg,
            height: 90,
          ),
          SizedBox(height: 12),
          GestureDetector(
            onTap: retryAction,
            child: Text(
              tips ?? '暂无数据',
              style: TextStyle(
                  fontSize: 14, color: Color.fromARGB(255, 238, 160, 85)),
            ),
          ),
        ],
      ),
    );
  }
}


